myApp.controller('content_add', function ($rootScope, $scope, $http, $uibModalInstance, httpService, formBoxData) {
	
	/*关闭的图片*/
	$scope.closeImg={'img':'images/close-default.png','defaultImg':'images/close-default.png','downImg':'images/close-btndown.png','hoverImg':'images/close-hover.png'};
    $scope.title = formBoxData.title;
    $scope.formData = {
        id:"",
        content:"",
        sysName:"",
        assetType:"",
        resultTypeLocal:"",
        remark:""
    };

    // 获取资产类型列表
    $scope.getAssetTypeList = function () {
        $http({
            method: 'GET',
            url: 'json/assetTypeList.json'
        }).success(function (response) {
            $scope.assetTypeList = response.data;
            //$scope.formData.assetType = undefined;
        }).error(function (response) {
            // called asynchronously if an error occurs
            // or server returns response with an error status.
        });
    };

    // 获取巡检结果类型列表
    $scope.getResultTypeList = function () {
        $http({
            method: 'GET',
            url: 'json/inspectionResultType.json'
        }).success(function (response) {
            $scope.resultTypeList = response.data;
           // $scope.formData.resultTypeLocal = undefined;
        }).error(function (response) {
            // called asynchronously if an error occurs
            // or server returns response with an error status.
        });
    };

    function formInit() {
        $scope.getAssetTypeList();
        $scope.getResultTypeList();
    }
    formInit();

    // 保存
    $scope.ok = function() {
        /*httpService.postRequest(formBoxData.modalApi, $scope.formData).then(function(res){
            var result = res.data;
            if(res.resultCode === 0){
                var assetsOperation = {
                    assetsId: result.data.id,
                    dealStatus: '入库'
                };
                formBoxData.confirmFunc();
                httpService.insertAssetsOperation(assetsOperation);
            }
            console.log(res);
            $scope.cancel();
        });*/
    };
    // 取消
    $scope.cancel = function () {
        $uibModalInstance.dismiss('cancel');
    };
});
